<template>
  <div>
    <el-form
      :inline="true"
      :model="formInline"
      class="demo-form-inline"
    >

      <el-form-item label="区域">
        <el-select
          v-model="formInline.region"
          placeholder="区域"
          @change="ondatachange"
        >
          <el-option
            label="天河区"
            value="shanghai"
          ></el-option>
          <el-option
            label="越秀区"
            value="beijing"
          ></el-option>
          <el-option
            label="荔湾区"
            value="beijing"
          ></el-option>
          <el-option
            label="白云区"
            value="beijing"
          ></el-option>
          <el-option
            label="海珠区"
            value="beijing"
          ></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="学校名">
        <el-input
          v-model="formInline.user"
          placeholder="学校名"
        ></el-input>
      </el-form-item>
      <el-date-picker

        type="date"
        placeholder="选择日期"
      >
      </el-date-picker>
      <el-form-item>
        <el-button
          style="margin-left:30px;"
          type="primary"
          @click="onSubmit"
        >查询</el-button>
      </el-form-item>
    </el-form>

    <el-table
      :data="tableData"
      border
      style="width: 100%"
    >
      <el-table-column
        type="index"
        width="50"
      >
      </el-table-column>
      <el-table-column
        prop="district"
        label="区域"
        width="180"
      >
      </el-table-column>

      <el-table-column
        prop="teachercount"
        label="变更人数"
      >
      </el-table-column>
      <el-table-column
        prop="bestsubject"
        label="选科占比"
      >
      </el-table-column>
      <el-table-column label="操作">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="info"
            @click="handle_detail(scope.$index, scope.row)"
          >详情</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

    <script>
export default {
  data () {
    return {
      formInline: {
        user: '',
        region: ''
      },
      tableData: [{
                    district: '天河区',
                    schoolname: '13',
                    teachercount: '2284',
                    bestsubject: '13%'
                  }, {
                    district: '荔湾区',
                    schoolname: '9',
                    teachercount: '3010',
                    bestsubject: '14%'
                  }, {
                    district: '荔湾区',
                    schoolname: '15',
                    teachercount: '3868',
                    bestsubject: '16%'
                  }, {
                    district: '越秀区',
                    schoolname: '6',
                    teachercount: '1773',
                    bestsubject: '17.1%'
                  },
                  {
                    district: '黄埔区',
                    schoolname: '11',
                    teachercount: '1816',
                    bestsubject: '13.4%'
                  }, {
                    district: '海珠区',
                    schoolname: '15',
                    teachercount: '2622',
                    bestsubject: '16.7%'
                  }, {
                    district: '白云区',
                    schoolname: '16',
                    teachercount: '6435',
                    bestsubject: '12.9%'
                  }, {
                    district: '荔湾区',
                    schoolname: '9',
                    teachercount: '3057',
                    bestsubject: '15.7%'
                  }, {
                    district: '海珠区',
                    schoolname: '6',
                    teachercount: '811',
                    bestsubject: '14.9%'
                  }, {
                    district: '白云区',
                    schoolname: '8',
                    teachercount: '1989',
                    bestsubject: '16.7%'
                  }, {
                    district: '荔湾区',
                    schoolname: '11',
                    teachercount: '2635',
                    bestsubject: '14.9%'
                  }]
    }
  },
  methods: {
    handle_detail () {
      this.$router.push('/subject_analysis/subject_change_detail')
    },
    onSubmit () {

    },
    ondatachange () {
      this.tableData = [{
                          district: '华南师范大学附属中学',
                          schoolname: '13',
                          teachercount: '284',
                          bestsubject: '13%'
                        }, {
                          district: '广东实验中学附属天河学校',
                          schoolname: '9',
                          teachercount: '310',
                          bestsubject: '14%'
                        }, {
                          district: '广州市天河外国语学校',
                          schoolname: '15',
                          teachercount: '238',
                          bestsubject: '16%'
                        }, {
                          district: '广州市第47中学',
                          schoolname: '6',
                          teachercount: '173',
                          bestsubject: '13.1%'
                        },
                        {
                          district: '广州市天荣中学',
                          schoolname: '11',
                          teachercount: '186',
                          bestsubject: '13.4%'
                        }, {
                          district: '广州市华美英语实验学校',
                          schoolname: '15',
                          teachercount: '262',
                          bestsubject: '16.7%'
                        }, {
                          district: '广州市天秀中学',
                          schoolname: '16',
                          teachercount: '135',
                          bestsubject: '12.9%'
                        }, {
                          district: '广州市恒福中学高中部',
                          schoolname: '9',
                          teachercount: '157',
                          bestsubject: '15.7%'
                        }, {
                          district: '华南理工大学附属中学',
                          schoolname: '6',
                          teachercount: '121',
                          bestsubject: '14.9%'
                        }]
    }
  }
}

  </script>

  <style
    rel="stylesheet/scss"
    lang="scss"
    scoped
  >
  </style>

